package com.yc.common.enums;

/**
 * @Classname BaseUtil
 * @Description 状态码枚举值
 * @Version 1.0.0
 * @Date 2022/7/11 11:04
 * @Created by Mikechen
 */
public enum ResultCode {

    SUCCESS(200, "操作成功"),
    fail(201,"接口异常，请稍后再试"),
    BAD_REQUEST(300, "参数或者语法不对"),
    LOGIN_ERROR(400, "登陆失败,用户名或密码无效"),
    AUTH_ERROR(401,"身份认证失败"),
    NOT_FOUND(404, "请求的资源不存在"),
    SERVER_ERROR(500, "服务器内部错误"),
    TIME_OUT(501, "请求超时"),
    BUSINESS_ERROR(700,"业务异常"),
    REDIS_ERROR(800,"REDIS操作异常"),
    SQL_ERROR(900,"数据库操作异常");

    private final int code;

    private final String msg;

    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
